<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>函数</title>
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <style>
        img{max-width: 650px;}
    </style>
</head>
<body class="container">
<h1>函数</h1>
<div class="well">
    <h4>在Node.js中，一个函数可以作为另一个函数的参数</h4>
    <xmp>
        function say(word) {
        console.log(word);
        }

        function execute(someFunction, value) {
        someFunction(value);
        }

        execute(say, "Hello");
    </xmp>
    <h4>匿名函数</h4>
    <xmp>
        function execute(someFunction, value) {
        someFunction(value);
        }
        execute(function(word){ console.log(word) }, "Hello");
    </xmp>
</div>
</body>
</html>